gdk/toplevel: Negotiate surface size via a compute-size signal
authorJonas Ådahl <jadahl@gmail.com>
Thu, 30 Jul 2020 21:06:59 +0000 (23:06 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 5 Aug 2020 13:49:00 +0000 (15:49 +0200)
commit2ff74eb667c2cbe293c7309d5661fa438e8431c4
tree67d4f4087f45decc59014e07fb643e169cb2a10f
parent4ee82e8175d1d1ed21d3ef8133f0d76267bde75c
gdk/toplevel: Negotiate surface size via a compute-size signal

GTK will not up front know how to correctly calculate a size, since it
will not be able to reliably predict the constraints that may exist
where it will be mapped.

Thus, to handle this, calculate the size of the toplevel by having GDK
emitting a signal called 'compute-size' that will contain information
needed for computing a toplevel window size.

This signal may be emitted at any time, e.g. during
gdk_toplevel_present(), or spontaneously if constraints change.

This also drops the max size from the toplevel layout, while moving the
min size from the toplevel layout struct to the struct passed via the
signal,

This needs changes to a test case where we make sure we process
GDK_CONFIGURE etc, which means we also needs to show the window and
process all pending events in the test-focus-chain test case.
28 files changed:
docs/reference/gdk/gdk4-sections.txt
gdk/broadway/gdksurface-broadway.c
gdk/gdk.h
gdk/gdksurface.c
gdk/gdksurface.h
gdk/gdktoplevel.c
gdk/gdktoplevel.h
gdk/gdktoplevellayout.c
gdk/gdktoplevellayout.h
gdk/gdktoplevelprivate.h
gdk/gdktoplevelsize.c [new file with mode: 0644]
gdk/gdktoplevelsize.h [new file with mode: 0644]
gdk/gdktoplevelsizeprivate.h [new file with mode: 0644]
gdk/macos/gdkmacostoplevelsurface.c
gdk/meson.build
gdk/wayland/gdksurface-wayland.c
gdk/win32/gdksurface-win32.c
gdk/x11/gdksurface-x11.c
gtk/gtkwindow.c
gtk/inspector/general.c
tests/rendernode.c
tests/showrendernode.c
tests/testfullscreen.c
testsuite/gsk/compare-render.c
testsuite/gtk/defaultvalue.c
testsuite/gtk/notify.c
testsuite/gtk/shortcuts.c
testsuite/gtk/test-focus-chain.c